home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / doom / quake2.zip / DMMDE321.ZIP / TARBABY.QC < prev    next >
Text File  |  1996-08-16  |  8KB  |  255 lines

  1. /*
  2. ==============================================================================
  3.  
  4. BLOB
  5.  
  6. ==============================================================================
  7. */
  8.  
  9. $cd /raid/quake/id1/models/tarbaby
  10. $origin 0 0 24
  11. $base base        
  12.  
  13. $skin skin
  14.  
  15. $frame walk1 walk2 walk3 walk4  walk5 walk6 walk7 walk8 walk9 walk10
  16. $frame walk11 walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19
  17. $frame walk20 walk21 walk22 walk23 walk24 walk25
  18.  
  19. $frame run1 run2 run3 run4 run5 run6  run7 run8 run9 run10 run11 run12 run13
  20. $frame run14 run15 run16 run17 run18 run19 run20 run21 run22 run23
  21. $frame run24 run25
  22.  
  23. $frame jump1 jump2 jump3 jump4 jump5 jump6
  24.  
  25. $frame fly1 fly2 fly3 fly4
  26.  
  27. $frame exp
  28.  
  29. void()  tarbaby_respawn;
  30.  
  31. void()    tbaby_stand1    =[    $walk1,        tbaby_stand1    ] {ai_stand();};
  32.  
  33. void()    tbaby_hang1        =[    $walk1,        tbaby_hang1    ] {ai_stand();};
  34.  
  35. void()    tbaby_walk1    =[    $walk1,        tbaby_walk2    ] {ai_turn();};
  36. void()    tbaby_walk2    =[    $walk2,        tbaby_walk3    ] {ai_turn();};
  37. void()    tbaby_walk3    =[    $walk3,        tbaby_walk4    ] {ai_turn();};
  38. void()    tbaby_walk4    =[    $walk4,        tbaby_walk5    ] {ai_turn();};
  39. void()    tbaby_walk5    =[    $walk5,        tbaby_walk6    ] {ai_turn();};
  40. void()    tbaby_walk6    =[    $walk6,        tbaby_walk7    ] {ai_turn();};
  41. void()    tbaby_walk7    =[    $walk7,        tbaby_walk8    ] {ai_turn();};
  42. void()    tbaby_walk8    =[    $walk8,        tbaby_walk9    ] {ai_turn();};
  43. void()    tbaby_walk9    =[    $walk9,        tbaby_walk10    ] {ai_turn();};
  44. void()    tbaby_walk10    =[    $walk10,        tbaby_walk11    ] {ai_turn();};
  45. void()    tbaby_walk11    =[    $walk11,        tbaby_walk12    ] {ai_walk(2);};
  46. void()    tbaby_walk12    =[    $walk12,        tbaby_walk13    ] {ai_walk(2);};
  47. void()    tbaby_walk13    =[    $walk13,        tbaby_walk14    ] {ai_walk(2);};
  48. void()    tbaby_walk14    =[    $walk14,        tbaby_walk15    ] {ai_walk(2);};
  49. void()    tbaby_walk15    =[    $walk15,        tbaby_walk16    ] {ai_walk(2);};
  50. void()    tbaby_walk16    =[    $walk16,        tbaby_walk17    ] {ai_walk(2);};
  51. void()    tbaby_walk17    =[    $walk17,        tbaby_walk18    ] {ai_walk(2);};
  52. void()    tbaby_walk18    =[    $walk18,        tbaby_walk19    ] {ai_walk(2);};
  53. void()    tbaby_walk19    =[    $walk19,        tbaby_walk20    ] {ai_walk(2);};
  54. void()    tbaby_walk20    =[    $walk20,        tbaby_walk21    ] {ai_walk(2);};
  55. void()    tbaby_walk21    =[    $walk21,        tbaby_walk22    ] {ai_walk(2);};
  56. void()    tbaby_walk22    =[    $walk22,        tbaby_walk23    ] {ai_walk(2);};
  57. void()    tbaby_walk23    =[    $walk23,        tbaby_walk24    ] {ai_walk(2);};
  58. void()    tbaby_walk24    =[    $walk24,        tbaby_walk25    ] {ai_walk(2);};
  59. void()    tbaby_walk25    =[    $walk25,        tbaby_walk1    ] {ai_walk(2);};
  60.  
  61. void()    tbaby_run1    =[    $run1,        tbaby_run2    ] {ai_face();};
  62. void()    tbaby_run2    =[    $run2,        tbaby_run3    ] {ai_face();};
  63. void()    tbaby_run3    =[    $run3,        tbaby_run4    ] {ai_face();};
  64. void()    tbaby_run4    =[    $run4,        tbaby_run5    ] {ai_face();};
  65. void()    tbaby_run5    =[    $run5,        tbaby_run6    ] {ai_face();};
  66. void()    tbaby_run6    =[    $run6,        tbaby_run7    ] {ai_face();};
  67. void()    tbaby_run7    =[    $run7,        tbaby_run8    ] {ai_face();};
  68. void()    tbaby_run8    =[    $run8,        tbaby_run9    ] {ai_face();};
  69. void()    tbaby_run9    =[    $run9,        tbaby_run10    ] {ai_face();};
  70. void()    tbaby_run10    =[    $run10,        tbaby_run11    ] {ai_face();};
  71. void()    tbaby_run11    =[    $run11,        tbaby_run12    ] {ai_run(2);};
  72. void()    tbaby_run12    =[    $run12,        tbaby_run13    ] {ai_run(2);};
  73. void()    tbaby_run13    =[    $run13,        tbaby_run14    ] {ai_run(2);};
  74. void()    tbaby_run14    =[    $run14,        tbaby_run15    ] {ai_run(2);};
  75. void()    tbaby_run15    =[    $run15,        tbaby_run16    ] {ai_run(2);};
  76. void()    tbaby_run16    =[    $run16,        tbaby_run17    ] {ai_run(2);};
  77. void()    tbaby_run17    =[    $run17,        tbaby_run18    ] {ai_run(2);};
  78. void()    tbaby_run18    =[    $run18,        tbaby_run19    ] {ai_run(2);};
  79. void()    tbaby_run19    =[    $run19,        tbaby_run20    ] {ai_run(2);};
  80. void()    tbaby_run20    =[    $run20,        tbaby_run21    ] {ai_run(2);};
  81. void()    tbaby_run21    =[    $run21,        tbaby_run22    ] {ai_run(2);};
  82. void()    tbaby_run22    =[    $run22,        tbaby_run23    ] {ai_run(2);};
  83. void()    tbaby_run23    =[    $run23,        tbaby_run24    ] {ai_run(2);};
  84. void()    tbaby_run24    =[    $run24,        tbaby_run25    ] {ai_run(2);};
  85. void()    tbaby_run25    =[    $run25,        tbaby_run1    ] {ai_run(2);};
  86.  
  87.  
  88. //============================================================================
  89.  
  90.  
  91. void()    tbaby_jump1;
  92.  
  93. void()    Tar_JumpTouch =
  94. {
  95.     local    float    ldmg;
  96.  
  97.     if (other.takedamage && other.classname != self.classname)
  98.     {
  99.         if ( vlen(self.velocity) > 400 )
  100.         {
  101.             ldmg = 10 + 10*random();
  102.             T_Damage (other, self, self, ldmg);    
  103.             sound (self, CHAN_WEAPON, "blob/hit1.wav", 1, ATTN_NORM);
  104.         }
  105.     }
  106.     else
  107.         sound (self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM);
  108.  
  109.  
  110.     if (!checkbottom(self))
  111.     {
  112.         if (self.flags & FL_ONGROUND)
  113.         {    // jump randomly to not get hung up
  114. //dprint ("popjump\n");
  115.     self.touch = SUB_Null;
  116.     self.think = tbaby_run1;
  117.     self.movetype = MOVETYPE_STEP;
  118.     self.nextthink = time + 0.1;
  119.  
  120. //            self.velocity_x = (random() - 0.5) * 600;
  121. //            self.velocity_y = (random() - 0.5) * 600;
  122. //            self.velocity_z = 200;
  123. //            self.flags = self.flags - FL_ONGROUND;
  124.         }
  125.         return;    // not on ground yet
  126.     }
  127.  
  128.     self.touch = SUB_Null;
  129.     self.think = tbaby_jump1;
  130.     self.nextthink = time + 0.1;
  131. };
  132.  
  133. void()    tbaby_jump5;
  134.  
  135. void()    tbaby_fly1        =[    $fly1,    tbaby_fly2    ] {};
  136. void()    tbaby_fly2        =[    $fly2,    tbaby_fly3    ] {};
  137. void()    tbaby_fly3        =[    $fly3,    tbaby_fly4    ] {};
  138. void()    tbaby_fly4        =[    $fly4,    tbaby_fly1    ] {
  139. self.cnt = self.cnt + 1;
  140. if (self.cnt == 4)
  141. {
  142. //dprint ("spawn hop\n");
  143. tbaby_jump5 ();
  144. }
  145. };
  146.  
  147. void()    tbaby_jump1        =[    $jump1,    tbaby_jump2        ] {ai_face();};
  148. void()    tbaby_jump2        =[    $jump2,    tbaby_jump3        ] {ai_face();};
  149. void()    tbaby_jump3        =[    $jump3,    tbaby_jump4        ] {ai_face();};
  150. void()    tbaby_jump4        =[    $jump4,    tbaby_jump5        ] {ai_face();};
  151. void()    tbaby_jump5        =[    $jump5,    tbaby_jump6        ]
  152. {    
  153.     self.movetype = MOVETYPE_BOUNCE;
  154.     self.touch = Tar_JumpTouch;
  155.     makevectors (self.angles);
  156.     self.origin_z = self.origin_z + 1;
  157.     self.velocity = v_forward * 600 + '0 0 200';
  158.     self.velocity_z = self.velocity_z + random()*150;
  159.     if (self.flags & FL_ONGROUND)
  160.         self.flags = self.flags - FL_ONGROUND;
  161.     self.cnt = 0;
  162. };
  163. void()    tbaby_jump6    =[    $jump6,tbaby_fly1    ] {};
  164.  
  165.  
  166.  
  167. //=============================================================================
  168.  
  169. void()    tbaby_die1    =[    $exp,        tbaby_die2    ] {
  170. self.takedamage = DAMAGE_NO;
  171. };
  172. void()    tbaby_die2    =[    $exp,        tbaby_run1    ] 
  173. {
  174.     T_RadiusDamage (self, self, 120, world);
  175.  
  176.     sound (self, CHAN_VOICE, "blob/death1.wav", 1, ATTN_NORM);
  177.     self.origin = self.origin - 8*normalize(self.velocity);
  178.  
  179.     WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  180.     WriteByte (MSG_BROADCAST, TE_TAREXPLOSION);
  181.     WriteCoord (MSG_BROADCAST, self.origin_x);
  182.     WriteCoord (MSG_BROADCAST, self.origin_y);
  183.     WriteCoord (MSG_BROADCAST, self.origin_z);
  184.     
  185.     BecomeExplosion ();
  186.  
  187.         if ((deathmatch == 6) || (deathmatch == 7))
  188.         {
  189.                 self.think = tarbaby_respawn;
  190.                 self.nextthink = time + 30;
  191.         }
  192.  
  193. };
  194.  
  195. //=============================================================================
  196.  
  197.  
  198. /*QUAKED monster_tarbaby (1 0 0) (-16 -16 -24) (16 16 24) Ambush
  199. */
  200. void() monster_tarbaby =
  201. {
  202.         if ((deathmatch < 4) && (deathmatch))
  203.     {
  204.         remove(self);
  205.         return;
  206.     }
  207.     precache_model2 ("progs/tarbaby.mdl");
  208.  
  209.     precache_sound2 ("blob/death1.wav");
  210.     precache_sound2 ("blob/hit1.wav");
  211.     precache_sound2 ("blob/land1.wav");
  212.     precache_sound2 ("blob/sight1.wav");
  213.     
  214.     self.solid = SOLID_SLIDEBOX;
  215.     self.movetype = MOVETYPE_STEP;
  216.  
  217.     setmodel (self, "progs/tarbaby.mdl");
  218.         self.oldorigin = self.origin;
  219.  
  220.     setsize (self, '-16 -16 -24', '16 16 40');
  221.     self.health = 80;
  222.  
  223.     self.th_stand = tbaby_stand1;
  224.     self.th_walk = tbaby_walk1;
  225.     self.th_run = tbaby_run1;
  226.     self.th_missile = tbaby_jump1;
  227.     self.th_melee = tbaby_jump1;
  228.     self.th_die = tbaby_die1;
  229.     
  230.     walkmonster_start ();
  231. };
  232.  
  233. void() tarbaby_respawn =
  234. {
  235.         spawn_tfog(self.oldorigin);
  236.         spawn_tdeath(self.oldorigin, self);
  237.  
  238.     setmodel (self, "progs/tarbaby.mdl");
  239.  
  240.     self.solid = SOLID_SLIDEBOX;
  241.     self.movetype = MOVETYPE_STEP;
  242.  
  243.     setsize (self, '-16 -16 -24', '16 16 40');
  244.     self.health = 80;
  245.  
  246.     self.th_stand = tbaby_stand1;
  247.     self.th_walk = tbaby_walk1;
  248.     self.th_run = tbaby_run1;
  249.     self.th_missile = tbaby_jump1;
  250.     self.th_melee = tbaby_jump1;
  251.     self.th_die = tbaby_die1;
  252.     
  253.     walkmonster_start ();
  254. };
  255.